<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/corelib/kernel/qmetaobject.cpp -->
<head>
  <title>Qt 4.3: QMetaProperty Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QMetaProperty Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1>
<p>The QMetaProperty class provides meta-data about a property. <a href="#details">More...</a></p>
<pre> #include &lt;QMetaProperty&gt;</pre><ul>
<li><a href="qmetaproperty-members.html">List of all members, including inherited members</a></li>
<li><a href="qmetaproperty-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/>QMetaEnum <b><a href="qmetaproperty.html#enumerator">enumerator</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isDesignable">isDesignable</a></b> ( const QObject * <i>object</i> = 0 ) const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isEnumType">isEnumType</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isFlagType">isFlagType</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isReadable">isReadable</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isResettable">isResettable</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isScriptable">isScriptable</a></b> ( const QObject * <i>object</i> = 0 ) const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isStored">isStored</a></b> ( const QObject * <i>object</i> = 0 ) const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isUser">isUser</a></b> ( const QObject * <i>object</i> = 0 ) const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isValid">isValid</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#isWritable">isWritable</a></b> () const</li>
<li><div class="fn"/>const char * <b><a href="qmetaproperty.html#name">name</a></b> () const</li>
<li><div class="fn"/>QVariant <b><a href="qmetaproperty.html#read">read</a></b> ( const QObject * <i>object</i> ) const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#reset">reset</a></b> ( QObject * <i>object</i> ) const</li>
<li><div class="fn"/>QVariant::Type <b><a href="qmetaproperty.html#type">type</a></b> () const</li>
<li><div class="fn"/>const char * <b><a href="qmetaproperty.html#typeName">typeName</a></b> () const</li>
<li><div class="fn"/>int <b><a href="qmetaproperty.html#userType">userType</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qmetaproperty.html#write">write</a></b> ( QObject * <i>object</i>, const QVariant &amp; <i>value</i> ) const</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QMetaProperty class provides meta-data about a property.</p>
<p>A property has a <a href="qmetaproperty.html#name">name</a>() and a <a href="qmetaproperty.html#type">type</a>(), as well as various attributes that specify its behavior: <a href="qmetaproperty.html#isReadable">isReadable</a>(), <a href="qmetaproperty.html#isWritable">isWritable</a>(), <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), <a href="qmetaproperty.html#isScriptable">isScriptable</a>(), and <a href="qmetaproperty.html#isStored">isStored</a>().</p>
<p>If the property is an enumeration, <a href="qmetaproperty.html#isEnumType">isEnumType</a>() returns true; if the property is an enumeration that is also a flag (i.e&#x2e; its values can be combined using the OR operator), <a href="qmetaproperty.html#isEnumType">isEnumType</a>() and <a href="qmetaproperty.html#isFlagType">isFlagType</a>() both return true. The enumerator for these types is available from <a href="qmetaproperty.html#enumerator">enumerator</a>().</p>
<p>The property's values are set and retrieved with <a href="qmetaproperty.html#read">read</a>(), <a href="qmetaproperty.html#write">write</a>(), and <a href="qmetaproperty.html#reset">reset</a>(); they can also be changed through <a href="qobject.html">QObject</a>'s set and get functions. See <a href="qobject.html#setProperty">QObject::setProperty</a>() and <a href="qobject.html#property">QObject::property</a>() for details.</p>
<p>You get property meta-data through an object's meta-object. See <a href="qmetaobject.html#property">QMetaObject::property</a>() and <a href="qmetaobject.html#propertyCount">QMetaObject::propertyCount</a>() for details.</p>
<p>See also <a href="qmetaobject.html">QMetaObject</a>, <a href="qmetaenum.html">QMetaEnum</a>, <a href="qmetamethod.html">QMetaMethod</a>, and <a href="properties.html">Qt's Property System</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="enumerator"></a><a href="qmetaenum.html">QMetaEnum</a> QMetaProperty::enumerator () const</h3>
<p>Returns the enumerator if this property's type is an enumerator type; otherwise the returned value is undefined.</p>
<p>See also <a href="qmetaproperty.html#isEnumType">isEnumType</a>() and <a href="qmetaproperty.html#isFlagType">isFlagType</a>().</p>
<h3 class="fn"><a name="isDesignable"></a>bool QMetaProperty::isDesignable ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</h3>
<p>Returns true if this property is designable for the given <i>object</i>; otherwise returns false.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>DESIGNABLE</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isScriptable">isScriptable</a>() and <a href="qmetaproperty.html#isStored">isStored</a>().</p>
<h3 class="fn"><a name="isEnumType"></a>bool QMetaProperty::isEnumType () const</h3>
<p>Returns true if the property's type is an enumeration value; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#enumerator">enumerator</a>() and <a href="qmetaproperty.html#isFlagType">isFlagType</a>().</p>
<h3 class="fn"><a name="isFlagType"></a>bool QMetaProperty::isFlagType () const</h3>
<p>Returns true if the property's type is an enumeration value that is used as a flag; otherwise returns false.</p>
<p>Flags can be combined using the OR operator. A flag type is implicitly also an enum type.</p>
<p>See also <a href="qmetaproperty.html#isEnumType">isEnumType</a>(), <a href="qmetaproperty.html#enumerator">enumerator</a>(), and <a href="qmetaenum.html#isFlag">QMetaEnum::isFlag</a>().</p>
<h3 class="fn"><a name="isReadable"></a>bool QMetaProperty::isReadable () const</h3>
<p>Returns true if this property is readable; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#isWritable">isWritable</a>(), <a href="qmetaproperty.html#read">read</a>(), and <a href="qmetaproperty.html#isValid">isValid</a>().</p>
<h3 class="fn"><a name="isResettable"></a>bool QMetaProperty::isResettable () const</h3>
<p>Returns true if this property can be reset to a default value; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#reset">reset</a>().</p>
<h3 class="fn"><a name="isScriptable"></a>bool QMetaProperty::isScriptable ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</h3>
<p>Returns true if the property is scriptable for the given <i>object</i>; otherwise returns false.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>SCRIPTABLE</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isDesignable">isDesignable</a>() and <a href="qmetaproperty.html#isStored">isStored</a>().</p>
<h3 class="fn"><a name="isStored"></a>bool QMetaProperty::isStored ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</h3>
<p>Returns true if the property is stored for <i>object</i>; otherwise returns false.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>STORED</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaproperty.html#isDesignable">isDesignable</a>() and <a href="qmetaproperty.html#isScriptable">isScriptable</a>().</p>
<h3 class="fn"><a name="isUser"></a>bool QMetaProperty::isUser ( const <a href="qobject.html">QObject</a> * <i>object</i> = 0 ) const</h3>
<p>Returns true if this is the property that the user can editable for <i>object</i>; otherwise returns false. I.e&#x2e; the text property is the user editable property of a <a href="qlineedit.html">QLineEdit</a>.</p>
<p>If no <i>object</i> is given, the function returns false if the <tt>Q_PROPERTY()</tt>'s <tt>USER</tt> attribute is false; otherwise returns true (if the attribute is true or is a function or expression).</p>
<p>See also <a href="qmetaobject.html#userProperty">QMetaObject::userProperty</a>(), <a href="qmetaproperty.html#isDesignable">isDesignable</a>(), and <a href="qmetaproperty.html#isScriptable">isScriptable</a>().</p>
<h3 class="fn"><a name="isValid"></a>bool QMetaProperty::isValid () const</h3>
<p>Returns true if this property is valid (readable); otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#isReadable">isReadable</a>().</p>
<h3 class="fn"><a name="isWritable"></a>bool QMetaProperty::isWritable () const</h3>
<p>Returns true if this property is writable; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#isReadable">isReadable</a>() and <a href="qmetaproperty.html#write">write</a>().</p>
<h3 class="fn"><a name="name"></a>const char * QMetaProperty::name () const</h3>
<p>Returns this property's name.</p>
<p>See also <a href="qmetaproperty.html#type">type</a>() and <a href="qmetaproperty.html#typeName">typeName</a>().</p>
<h3 class="fn"><a name="read"></a><a href="qvariant.html">QVariant</a> QMetaProperty::read ( const <a href="qobject.html">QObject</a> * <i>object</i> ) const</h3>
<p>Reads the property's value from the given <i>object</i>. Returns the value if it was able to read it; otherwise returns an invalid variant.</p>
<p>See also <a href="qmetaproperty.html#write">write</a>(), <a href="qmetaproperty.html#reset">reset</a>(), and <a href="qmetaproperty.html#isReadable">isReadable</a>().</p>
<h3 class="fn"><a name="reset"></a>bool QMetaProperty::reset ( <a href="qobject.html">QObject</a> * <i>object</i> ) const</h3>
<p>Resets the property for the given <i>object</i> with a reset method. Returns true if the reset worked; otherwise returns false.</p>
<p>Reset methods are optional; only a few properties support them.</p>
<p>See also <a href="qmetaproperty.html#read">read</a>() and <a href="qmetaproperty.html#write">write</a>().</p>
<h3 class="fn"><a name="type"></a><a href="qvariant.html#Type-enum">QVariant::Type</a> QMetaProperty::type () const</h3>
<p>Returns this property's type. The return value is one of the values of the <a href="qvariant.html#Type-enum">QVariant::Type</a> enumeration.</p>
<p>See also <a href="qmetaproperty.html#userType">userType</a>(), <a href="qmetaproperty.html#typeName">typeName</a>(), and <a href="qmetaproperty.html#name">name</a>().</p>
<h3 class="fn"><a name="typeName"></a>const char * QMetaProperty::typeName () const</h3>
<p>Returns the name of this property's type.</p>
<p>See also <a href="qmetaproperty.html#type">type</a>() and <a href="qmetaproperty.html#name">name</a>().</p>
<h3 class="fn"><a name="userType"></a>int QMetaProperty::userType () const</h3>
<p>Returns this property's user type. The return value is one of the values that are registered with <a href="qmetatype.html">QMetaType</a>, or 0 if the type is not registered.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qmetaproperty.html#type">type</a>(), <a href="qmetatype.html">QMetaType</a>, and <a href="qmetaproperty.html#typeName">typeName</a>().</p>
<h3 class="fn"><a name="write"></a>bool QMetaProperty::write ( <a href="qobject.html">QObject</a> * <i>object</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> ) const</h3>
<p>Writes <i>value</i> as the property's value to the given <i>object</i>. Returns true if the write succeeded; otherwise returns false.</p>
<p>See also <a href="qmetaproperty.html#read">read</a>(), <a href="qmetaproperty.html#reset">reset</a>(), and <a href="qmetaproperty.html#isWritable">isWritable</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
